/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"6DF9C132-AFAB-43F9-9A28-5ABD6E8CA32F",variableType:4}
 */
var f_diagnostico = null;

/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"1136B8E2-52BD-40C6-9E44-2D9321F5216E",variableType:4}
 */
var f_tipoInfeccion = null;

/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"ECA53CB0-1656-46B6-8298-1A7EE6CA6705",variableType:4}
 */
var f_hospital = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"F51F0E30-9B5C-4CF6-AF01-1717D58894DC"}
 */
var f_apellido = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"72A3FA9F-E3C9-4660-A5DC-5E790184D453"}
 */
var f_nombre = null;

/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"CCFEF0C9-B5AE-4382-875D-B73E3610EB02",variableType:4}
 */
var f_documento = null;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} [event] the event that triggered the action
 *
 * @properties={typeid:24,uuid:"E84375CA-42A4-4076-9AF0-87DCA0D6EF78"}
 * @AllowToRunInFind
 */
function buscar(event) 
{
	if(controller.find() == false)
	{
		globals.gMensaje = 'No se pudo iniciar la búsqueda';
		globals.DIALOGS.showWarningDialog('Aviso',globals.gMensaje,'OK')
		return false; 
	}

	if (f_apellido != null)
		apellido = '#%' + f_apellido + '%';

	if (f_nombre != null)
		nombre = '#%' + f_nombre + '%';
	
	if (f_documento != null)
	{
		nro_documento = f_documento
	}
	if (f_diagnostico != null)
	{
		diagnostico_id = f_diagnostico
	}
	if (f_hospital != null)
	{
		hospital_id = f_hospital
	}
	if (f_tipoInfeccion != null)
	{
		infeccion_id = f_tipoInfeccion
	}
	var found = controller.search()
	if(found == 0)
	{
		globals.gMensaje = 'No encontró pacientes con esas condiciones'
		globals.DIALOGS.showInfoDialog('Aviso',globals.gMensaje,'OK')
		return true;
	}
	return true;
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"C7845631-E813-4B27-8445-1F55FAB1A227"}
 */
function anular(event) 
{
	f_apellido 		= null;
	f_nombre		= null;
	f_documento		= null;
	f_diagnostico 	= null
	f_hospital 		= null
	f_tipoInfeccion = null
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"FC0E5525-FBD2-46D0-BB95-9F5FB49E3D4B"}
 */
function ir_a_detalle(event) 
{
	globals.mostrarForm("pacientes_det"); 
}
